﻿using System.Windows;
using NUnit.Framework;
using Dsl.Ped.Common.Converters;

namespace DSLPedCommonTest.Converters
{
    [TestFixture, RequiresSTA]
    public class BoolToVisibilityConverterTest
    {
        private BoolToVisibilityConverter converter;

        [SetUp]
        public void SetUpForEachTest()
        {
            converter = new BoolToVisibilityConverter();          
        }

        [Test, Description("Convert True/False, check Visibility")]
        public void BoolToVisibleWithoutParameterTest()
        {                                     
            var obj = converter.Convert(true, typeof(Visibility), null, null );
            Assert.AreEqual(Visibility.Visible, (Visibility)obj);

            obj = converter.Convert(false, typeof(Visibility), null, null);
            Assert.AreEqual(Visibility.Hidden, (Visibility)obj);
        }

        [Test, Description("Convert True/False, check Visibility, parameter on the input")]
        public void BoolToVisibleWithParameterTest()
        {
            var obj = converter.Convert(true, typeof(Visibility), Visibility.Collapsed, null);
            Assert.AreEqual(Visibility.Visible, (Visibility)obj);

            obj = converter.Convert(false, typeof(Visibility), Visibility.Collapsed, null);
            Assert.AreEqual(Visibility.Collapsed, (Visibility)obj);
        }
    }
}
